﻿@{
    ViewData["Title"] = "StatementRoleView";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h1>权益类型</h1>
<div id="lop">
    <div class="layui-form-item">
        <label class="layui-form-label">权益名称</label>
        <div class="layui-input-block">
            <span id="lop-name" style="padding: 15px"></span>
        </div>
    </div>
</div>
<h1>权益规则</h1>

<script>
    layui.use(['table', 'jquery', 'layer', 'form', 'laypage', 'element', 'laydate'], function () {


        var table = layui.table;
        var $ = layui.jquery;
        var form = layui.form;
        var layer = layui.layer;
        var laypage = layui.laypage;
        var element = layui.element;
        var laydate = layui.laydate;

        var id = window.location.href.split('=')[1];
        statementView()
        function statementView() {
            $.ajax({
                url: 'http://localhost:5174/api/Statement/EditStatement',
                type: 'post',
                contentType: "application/json",
                data: JSON.stringify({ Id: id }),
                headers: {
                    "Authorization": "Bearer " + localStorage.getItem('token')
                },
                async: true,
                success: function (res) {
                    console.log(res.data);
                    document.getElementById("lop-name").innerHTML = res.data.statementName;

                },
                error: function (error) {
                    console.error(error);
                }
            });
        }







    })
</script>

<style>
    body {
        background-color: #f1f1f1;
    }

    #lop {
        margin-top: 30px;
        background-color: white;
        border-radius: 3px;
        padding: 5px
    }
</style>
